package com.yanu.t2s.service.Impl;

import com.yanu.t2s.entity.Meat;
import com.yanu.t2s.mapper.MeatMapper;
import com.yanu.t2s.service.MeatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MeatServiceImpl implements MeatService {
    @Autowired
    MeatMapper meatMapper;
    @Override
    public Meat findByIdMeat(int id_meat) {
        return meatMapper.findByIdMeat(id_meat);
    }

    @Override
    public List<Meat> findAllMeat() {
        return meatMapper.findAllMeat();
    }

    @Override
    public void insertmeat(Meat meat) {
        meatMapper.insertmeat(meat);
    }
    //属于某个tuzai户的所有猪肉
    @Override
    public List<Meat> findAllmeatofonetuzai(int id_tuzai) {
        return meatMapper.findAllmeatofonetuzai(id_tuzai);
    }
    //属于某个Pifa的所有猪肉
    @Override
    public List<Meat> findAllmeatofonepifa(int id_pifa) {
        return meatMapper.findAllmeatofonepifa(id_pifa);
    }
    //批发对屠宰买猪肉
    @Override
    public void buymeatwithpifa(int id_pifa, int id_meat) {
        meatMapper.buymeatwithpifa(id_pifa,id_meat);
    }
    //零售对批发买猪肉
    @Override
    public void buymeatwithlingshou(int id_lingshou, int id_meat) {
        meatMapper.buymeatwithlingshou(id_lingshou,id_meat);
    }
}
